﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage<Defect_Tracking_System.Models.ProjectMemberModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ChangeProjectMember
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="page-heading">
		<h1>Change Project Member</h1>
	</div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="/Content/images/shared/side_shadowleft.jpg" width="20" height="300" alt=""/></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="/Content/images/shared/side_shadowright.jpg" width="20" height="300" alt=""/></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td valign="top">
        		<!--  start content-table-inner ...................................................................... START -->
		<div id="content-table-inner">
		    <form id="mainform" action="/Project/ChangeProjectMember?projectMemberPageIndex=<%: Model.projectMemberPageIndex %>&accountPageIndex=<%: Model.groupMembersPageIndex %>&keyWord=<%: Model.keyWord %>" method="post" onsubmit="javascript:history.back(); return false;">
            <input type="hidden" id="ProjectId" name="ProjectId" value="<%: Model.projectId %>" />
			<!--  start table-content  -->
			<div id="table-content">
            <input type="text" name="Search" id="SearchMember" onfocus="if(this.value=='Search Member') this.value=''" onblur="if(this.value=='') this.value='Search Member'" value="<%: Model.keyWord %>" onkeyup="searchMember(this)" /><br /><br />
            <div style="float:left; width:100%">
            <h2>Project Member List</h2>
            <table id="ProjectMembers" class="product-table" cellspacing="0" cellpadding="0" border="0">
                <tr>
                    <%--<th class="table-header-check"><a id="projectMember-toggle-all" ></a></th>--%>
                    <th class="table-header-repeat line-left" style="width:150px"><a href="#">UserName</a></th>
                    <th class="table-header-repeat line-left" style="width:150px"><a href="#">FirstName</a></th>
                    <th class="table-header-repeat line-left" style="width:150px"><a href="#">LastName</a></th>
                    <th class="table-header-repeat line-left" style="width:250px"><a href="#">Email</a></th>
                    <th class="table-header-repeat line-left" style="width:150px"><a href="#">Is Assigned</a></th>
                    <th class="table-header-repeat line-left" style="width:100px"></th>
                </tr>

            <% foreach (Defect_Tracking_System.Models.MemberAccount item in Model.ProjectMembers)
                { %>
    
                <tr id="<%: item.AccountId %>">
                    <%--<td><input  type="checkbox" value="<%: item[0] %>"/></td>--%>
                    <td><%: item.UserName %></td>
                    <td><%: item.FirstName %></td>
                    <td><%: item.LastName %></td>
                    <td><%: item.Email %></td>
                    <td><% if (item.IsAssigned)
                            { %>
                            <input type="checkbox" name="isAssigned" value="<%: item.AccountId %>" class="isAssigned" checked="checked" onclick='changeAssign(this)' />
                    <% }
                            else
                            {%>
                            <input type="checkbox" name="isAssigned" value="<%: item.AccountId %>" class="isAssigned" onclick='changeAssign(this)' />
                    <%} %>
                    </td>
                    <td><a class="remove" href="/Project/AddRemoveProjectMember/<%: item.AccountId %>/<%: Model.projectId %>/<%: Model.groupMembersPageIndex %>/<%: Model.projectMemberPageIndex %>/remove/<%: Model.keyWord %>/View/false" onclick='return remove(this)'>Remove</a></td>
                </tr>
    
            <% } %>

            </table>
            <div id="ProjectMemberPageNavigator">
            <span id="proMemPrevious">
            <% if (Model.hasPreviousProjectMemberPage)
                {
                    if (Model.keyWord == "" || Model.keyWord == "Search Member")
                    {%>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/1/<%: Model.groupMembersPageIndex %>" class="page-far-left"></a>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex - 1 %>/<%: Model.groupMembersPageIndex %>" class="page-left"></a>
                        <%}
                    else
                    {%>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/1/<%: Model.groupMembersPageIndex %>/<%: Model.keyWord %>" class="page-far-left"></a>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex - 1 %>/<%: Model.groupMembersPageIndex %>/<%: Model.keyWord %>" class="page-left"></a>
                        <%}
                }%>
            </span>
            <div class="page-info">Page <strong id="projectMemberPageIndex"><%: Model.projectMemberPageIndex%></strong> / <span id="totalProjectMemberPage"><%: Model.totalProjectMemberPage%></span></div>
            <span id="proMemNext">
            <% if (Model.hasNextProjectMemberPage)
                {
                    if (Model.keyWord == "" || Model.keyWord == "Search Member")
                    {%>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex + 1 %>/<%: Model.groupMembersPageIndex %>" class="page-right"></a>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.totalProjectMemberPage %>/<%: Model.groupMembersPageIndex %>" class="page-far-right"></a>
                    <%}
                    else
                    {%>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex + 1 %>/<%: Model.groupMembersPageIndex %>/<%: Model.keyWord %>" class="page-right"></a>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.totalProjectMemberPage %>/<%: Model.groupMembersPageIndex %>/<%: Model.keyWord %>" class="page-far-right"></a>
                    <%}
                }       
                %>
                </span>
                </div>
            </div>
            <!--Group Member Table-->
            <div style="float:left; width:100%; margin-top:25px;">
            <h2>Members available for project</h2>
            <table id="GroupMembers" class="product-table" cellspacing="0" cellpadding="0" border="0">
                <tr>
                    <%--<th class="table-header-check"><a id="groupMember-toggle-all" ></a></th>--%>
                    <th class="table-header-repeat line-left" style="width:150px"><a href="#">UserName</a></th>
                    <th class="table-header-repeat line-left" style="width:150px"><a href="#">FirstName</a></th>
                    <th class="table-header-repeat line-left" style="width:150px"><a href="#">LastName</a></th>
                    <th class="table-header-repeat line-left" style="width:250px"><a href="#">Email</a></th>
                    <th class="table-header-repeat line-left" style="width:100px"><a href="#"> </a></th>
                </tr>
            <% foreach (Defect_Tracking_System.Models.MemberAccount item in Model.GroupMembers)
                { %>
    
                <tr id="<%: item.AccountId %>">
                    <%--<td><input  type="checkbox" value="<%: item.AccountId %>"/></td>--%>
                    <td><%: item.UserName%></td>
                    <td><%: item.FirstName %></td>
                    <td><%: item.LastName %></td>
                    <td><%: item.Email %></td>
                    <td><a class="add" href="/Project/AddRemoveProjectMember/<%: item.AccountId %>/<%: Model.projectId %>/<%: Model.groupMembersPageIndex %>/<%: Model.projectMemberPageIndex %>/add/<%: Model.keyWord %>/View/false" onclick='return add(this)'>Add</a></td>
                </tr>
            <% } %>
            </table>
            <div id="GroupMemberPageNavigator">
            <span id="groupPrevious">
            <% if (Model.hasPreviousGroupMembersPage)
                {
                    if (Model.keyWord == "" || Model.keyWord == "Search Member")
                    {%>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex %>/1" class="page-far-left"></a>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex %>/<%: Model.groupMembersPageIndex - 1 %>" class="page-left"></a>
                    <%}
                    else
                    {%>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex %>/1/<%: Model.keyWord %>" class="page-far-left"></a>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex %>/<%: Model.groupMembersPageIndex - 1 %>/<%: Model.keyWord %>" class="page-left"></a>
                    <%}
                }       
                %>
                </span>
            <div class="page-info">Page <strong id="groupMemberPageIndex"><%: Model.groupMembersPageIndex%></strong> / <span id="totalGroupMemberPage"><%: Model.totalGroupAccountPage%></span></div>
            <span id="groupNext">
            <% if (Model.hasNextGroupMembersPage)
                {
                    if (Model.keyWord == "" || Model.keyWord == "Search Member")
                    {%>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex %>/<%: Model.groupMembersPageIndex + 1 %>" class="page-right"></a>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex %>/<%: Model.totalGroupAccountPage %>" class="page-far-right"></a>
                    <%}
                    else
                    {%>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex %>/<%: Model.groupMembersPageIndex + 1 %>/<%: Model.keyWord %>" class="page-right"></a>
                        <a href="/Project/ChangeProjectMember/<%: Model.projectId %>/<%: Model.projectMemberPageIndex %>/<%: Model.totalGroupAccountPage %>/<%: Model.keyWord %>" class="page-far-right"></a>
                    <%}
                }       
                %>
                </span>
            </div>
           </div>
        </div>
        <div style="width:200px; margin:auto"><button type="submit" id="btnOk" style="width: 50px; height: 30px"class="button1">Ok</button>&nbsp;<button type="button" onclick="javascript:history.back()" class="button2">Back</button></div>
        </form>
        </div>
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
</table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Fotter" runat="server">
<img id="loading" src="/Content/images/shared/loading51.gif" width="100" height="100" style="z-index: 3333; display: none; position:absolute" />
<script type="text/javascript" src="/Scripts/ChangeProjectMemberScript.js"></script>
</asp:Content>

